import request from './request'
// 角色列表
export const roleList = (params) => {
  return request({
    url: '/role/list',
    method: 'get',
    param: params,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 管理员角色列表
export const roleDdminRoleList = (params) => {
  return request({
    url: '/role/adminRoleList',
    method: 'get',
    param: params,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 角色详情
export const roleDtail = (roleId) => {
  return request({
    url: '/role/detail',
    method: 'get',
    params: { roleId },
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 新增角色
export const roleAdd = (remarks, roleName) => {
  return request({
    url: '/role/add',
    method: 'get',
    params: {
      remarks: remarks,
      roleName: roleName
    },
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 修改角色
export const roleUpdate = (role) => {
  return request({
    url: '/role/update',
    method: 'post',
    data: role,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 删除角色
export const roleDelete = (roleId) => {
  return request({
    url: '/role/delete',
    method: 'get',
    params: { roleId },
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}
